#if 0
#ifndef _BUOLA_CV_CZEROSEGM_H
#define _BUOLA_CV_CZEROSEGM_H

#include <buola/image.h>
#include <buola/cv/corners.h>

namespace buola { namespace cvi {

class CZeroSegm
{
public:
    enum EMethod
    {
        METHOD_STANDARD,
        METHOD_GRAPHCUT,
        METHOD_WATERSHED,
        METHOD_WATERHUE,
        METHOD_WATERTABLE
    };
private:
    float DispSegment(Image<float> &dimg,Image<float> &cut,float mind,
                      float maxd,float xsiz);
    void TransformImage(Image<unsigned char> &limg,Image<unsigned char> &lrot,
                        float ydif,float zrot,float scale,bool nofilter);
    void Normalize(Image<unsigned char> &limg,Image<unsigned char> &rimg);
    int KeepLargestComp(Image<unsigned char> &mask,int minsize,int expxsize,
                        int expysize);
    void PrepareLogProbs(float mind,float maxd,int drange,float std,
                         float *probs);
    void WaterSegment(Image<unsigned char> &limg,Image<float> &disp,float mind,
                      float maxd,int drange,float std,Image<float> &cut,
                      float* table_probs=nullptr);
    void CollectHistograms(Image<float> &cut,Image<unsigned char> hue,
                           float *probf);
    void WaterHueSegment(Image<unsigned char> &clim,Image<unsigned char> &limg,
                         Image<float> &disp,float mind,float maxd,int drange,
                         float std,Image<float> &cut,float *table_probs=nullptr);
    void AllocateShm(int w,int h);
    void Rectify(Image<unsigned char> &limg,Image<unsigned char> &rimg,Image<
            unsigned char> &lout,Image<unsigned char> &rout,int nc=1);
    void BuildMaps();
public:
    CZeroSegm();
    ~CZeroSegm();
    int GetFrameNumber();
    void FreeShm();
    void GetShmData(short &key,int &size);
    unsigned char *GetShmPtr();
    int GetDispMemOffset();
    int GetMaskMemOffset();
    bool Active();
    void Active(bool act);
    bool Verbose();
    void Verbose(bool ver);
    bool Subsample();
    void Subsample(bool sub);
    void SetMethod(EMethod pMethod)
    {
        mMethod=pMethod;
    }
    short DispRange();
    void DispRange(short range);
    void GetMaps(float*& lmapX,float*& lmapY,float*& rmapX,float*& rmapY);
    void Update(Image<unsigned char> &clim,Image<unsigned char> &crim,bool yuv,
                float fovxdif,float fovydif,float fovzrot,bool oneshot);
private:
    EMethod mMethod;
    int mForegroundRange;
    struct timeval laststamp; // Time-out stamp
    unsigned char *shmData;
    ZeroSegm::ZeroDisparityMask *maskData;
    ZeroSegm::DisparityMap *dispData;
};

/*namespace cvi*/ } /*namespace buola*/ }

#endif // ZEROSEGM_H
#endif
